﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using WeddingEventManagement_API;

namespace WeddingEventManagementApp.Models
{
    public class Calendar_Entry
    {
        public int id       { get; set; }
        public string title { get; set; }
        public long start   { get; set; }
        public long end     { get; set; }
        public string url   { get; set; }
        public bool allDay  { get; set; }
        public string className { get; set; }
        public string color { get; set; }
    }

    public class EventDetails_VM
    {
        public int EventID { get; set; }

        public int ClientID { get; set; }

        public string ClientName { get; set; }

        public string Title { get; set; }

        public DateTime StartDate { get; set; }

        public string StartTime { get; set; }

        public DateTime EndDate { get; set; }

        public string EndTime { get; set; }

        public EventTypeEnum EventType { get; set; }

        public PackageType PackageType { get; set; }

        public DateTime? DateCreated { get; set; }

        public DateTime? LastUpdated { get; set; }

        public string CreatedBy { get; set; }

        public List<Location> Locations { get; set; }

    }

    //public class AutoCompleteLocations_VM
    //{
    //    public int ID { get; set; }
    //    public string Name { get; set; }
    //}

    public class Event_VM
    {
        public int EventID { get; set; }
        public string ClientName { get; set; }

        [Required (ErrorMessage="The Client field is required")]
        [Display]
        public int ClientID { get; set; }

        [Required(ErrorMessage = "An event title is required")]
        [Display (Prompt = "Event Title")]
        public string Title { get; set; }

        [DataType(DataType.Date)]
        [Required(ErrorMessage="Start Date is required")]
        [Display (Prompt = "Start Date")]
        public DateTime StartDate { get; set; }

        [Required]
        public string StartTime { get; set; }

        [Required(ErrorMessage = "End Date is required")]
        [Display(Prompt = "End Date")]
        [DataType(DataType.Date)]
        public DateTime EndDate { get; set; }

        [Required]
        public string EndTime { get; set; }

        [Required(ErrorMessage="Event Type is Required")]
        [Display(Prompt = "Event Type")]
        public EventTypeEnum EventType { get; set; }

        [Display(Prompt="Package Type")]
        public PackageType? PackageType { get; set; }

        [Display(Prompt = "Guests")]
        public int? Guests { get; set; }

        public bool Flowers { get; set; }
        public decimal? FlowerBudget { get; set; }
        public bool Decor { get; set; }
        public decimal? DecorBudget { get; set; }
        public bool Coordination { get; set; }
        public decimal? TotalBudget { get; set; }
        public string Notes { get; set; }
    }

    public class EventMain_VM
    {
        public IEnumerable<Event> RecentViewedEvents { get; set; }
        public IEnumerable<Event> UpcomingEvents { get; set; }
        public IEnumerable<Event> RecentAddedEvents { get; set; }
        public IEnumerable<EventType> EventTypes { get; set; }
    }

    public class NewEvent_VM
    {
        public int ID { get; set; }
        public int ClientID { get; set; }
        public int PackageID { get; set; }

        [Required]
        public string Title { get; set; }

        [Required]
        public DateTime Start { get; set; }

        [Required]
        public DateTime End { get; set; }

        [Required]
        public string EventType { get; set; }

        [Required]
        public IEnumerable<Location> Locations { get; set;}
    }

    public class EditEventLocation_VM
    {
        public Event e { get; set; }

        public EventLocation el { get; set; }

        public DateTime Date { get; set; }

        [Required]
        public string Time { get; set; }

        [Required]
        public int LocationID { get; set; }
        
        [Required]
        public string Type { get; set; }

        public string Notes { get; set; }
    }

    public class ExistingEventLocation_VM
    {
        [Required]
        public string Time { get; set; }

        public int EventID { get; set; }
        
        [Required]
        public int LocationID { get; set; }

        public Event e { get; set; }

        [Required]
        public string Type { get; set; }

        public string Notes { get; set; }
    }

    public class EventLocation_VM
    {
        [Timestamp]
        public string Time { get; set; }

        public int EventID { get; set; }

        public int LocationID { get; set; }

        public Event e { get; set; }

        [Required]
        public string Name { get; set; }

        [Required]
        public string Type { get; set; }

        [Required]
        public string Address { get; set; }

        [Required]
        public string City { get; set; }

        [Required]
        public int Province { get; set; }

        [Required]
        public string PostalCode { get; set; }

        public string ContactName { get; set; }

        [Phone]
        public string ContactPhone { get; set; }

        [EmailAddress]
        public string ContactEmail { get; set; }

        [Url]
        public string Website { get; set; }

        public string Notes { get; set; }

        public string LocationNotes { get; set; }

        public string Lat { get; set; }
        public string Lng { get; set; }
        public string LocationType { get; set; }
    }

    public class AutoCompleteEvent_VM
    {
        public int ID { get; set; }
        public string Title { get; set; }
        public string ClientName { get; set; }
        public string Date { get; set; }
        public string Color { get; set; }
    }

    public class Location_DDL
    {
        public int ID { get; set;}
        public string Name { get; set;}
    }

    public class DropdownList_JSON
    {
        public int ID { get; set; }
        public string Name { get; set; }
    }

}